home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / ncsat.cpt / Telnet2.5 final / main / switch.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-23  |  2.0 KB  |  70 lines

  1. /*
  2. *    switch.c
  3. *     by Gaige B. Paulsen
  4. ****************************************************************************
  5. *    Part of NCSA Telnet for the Macintosh                                   *
  6. *                                                                          *
  7. *      Uses    :                                                               *
  8. *      TCP/IP kernel for NCSA Telnet                                       *
  9. *      by Tim Krauskopf                                                    *
  10. *       with Macintosh code by Gaige B. Paulsen                                 *
  11. *                                                                          *
  12. *      National Center for Supercomputing Applications                     *
  13. *      152 Computing Applications Building                                 *
  14. *      605 E. Springfield Ave.                                             *
  15. *      Champaign, IL  61820                                                *
  16. *                                                                          *
  17. *                                                                          *
  18. ****************************************************************************
  19. *
  20. *    Switcher interface code for NCSA Telnet for the Macintosh
  21. *
  22. *    Called by:
  23. *        maclook.c
  24. */
  25.  
  26. #include <Dialogs.h>
  27. #include <Memory.h>
  28.  
  29. #include "configrec.h"
  30. #include "maclook.h"
  31.  
  32. #ifdef MPW
  33. #include "mpw.h"
  34. #endif
  35.  
  36. #define Ptr    char * 
  37.  
  38. typedef struct {
  39.     Ptr    worldPtr[8];            /* the world table */
  40.     Ptr    hostTask;                /* Who owns this joint anyway? */
  41.     Ptr    TheTask;                /* Who is on stage ? */
  42.  
  43. } switchStruct, *switchPtr, **switchHdl;
  44.  
  45. int    initBKGR(),netsleep(),BKGRtask();
  46.  
  47. int initswitch
  48.   (
  49.     void
  50.   )
  51. {
  52.     switchPtr    switcher;
  53.     switchHdl    switcherH= (switchHdl) 0x282L;
  54.     char **ptr;
  55.  
  56.     if (( *switcherH ==(switchHdl) 0L) || ( *switcherH ==(switchHdl) -1L) )
  57.         return(0);
  58.  
  59.     putln("WARNING!! You are running under switcher.  I may throw up! ");
  60.  
  61.     switcher = *switcherH;
  62.  
  63.     ptr= ((char **)ApplicZone()) -3L;        /* Set up our bkgrnd task  3 * 4 = 12*/
  64.     (*ptr) = (char *) BKGRtask;
  65.  
  66.     initBKGR( netsleep );        /* And tell it where to go */
  67.  
  68.     return(-1);        /* Yes we are under switcher .... */
  69. }
  70.